mkdir -p svg
for SVG in *.svg
do
	ICON=${SVG%.svg}
	X=$(inkscape --query-x $SVG)
	Y=$(inkscape --query-y $SVG)
	W=$(inkscape --query-width $SVG)
	H=$(inkscape --query-height $SVG)
	XD=${X%.*}
	YD=${Y%.*}
	WD=${W%.*}
	HD=${H%.*}
	inkscape --export-png=${ICON}.png --export-area-drawing ${ICON}.svg
	for MODE in "ldpi 36" "mdpi 48" "hdpi 72" "xhdpi 96"
	do
		set $MODE
		RES=$1
		PIXELS=$2
		mkdir -p drawable-${RES}
		convert ${ICON}.png -background none -gravity center -resize ${PIXELS}x${PIXELS} -extent ${PIXELS}x${PIXELS} drawable-${RES}/${ICON}.png
	done
done
